import { SET_USER_LIST ,ADD_USER} from "../action-types";
const actionCreators = {
  getUserList() {
    return function (dispatch, getState,require) {
      console.log(require,'Longin22');
      return require.get("/api/users").then((res) => {
        const {data} = res.data;
        console.log(res, data, "getUserList");
        dispatch({
          type: SET_USER_LIST,
          payload: data,
        });
      });
    };
  },

  addUser(user) {
    return {
      type: ADD_USER,
      payload: user,
    };
  },
};
export default actionCreators;
